package top.kaoshanji.r1ch04b.helloworld;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import top.kaoshanji.r1ch04b.speaker.Speaker;

/**
 * 代码清单-r1ch04b-85页b：运行一下
 * @author kaoshanji
 * ^_^
 * create time 2025/5/28 18:34
 */
@Configuration
@ComponentScan("top.kaoshanji.r1ch04b.helloworld")
public class Application {

    public static void main(String[] args) {

        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(Application.class);

        Speaker speaker = applicationContext.getBean("speaker", Speaker.class);
        System.out.println(speaker.speak());
    }

}
